import { _decorator, Component, Node, AnimationClip } from 'cc'
import { StateMachine } from '../../Base/StateMachine'
import { DIRECTION_ENUM, SPIKE_COUNT_ENUM } from '../../Enum'
import State, { ANIMATION_SPEED } from '../../Base/State'
import { DirectionSubStateMachine } from '../../Base/DirectionSubStateMachine'
const { ccclass, property } = _decorator

/**
 * Predefined variables
 * Name = IdleSubStateMachineSmoke
 * DateTime = Sat Jul 30 2022 15:09:34 GMT+0800 (中国标准时间)
 * Author = Zero_Y
 * FileBasename = IdleSubStateMachineSmoke.ts
 * FileBasenameNoExtension = IdleSubStateMachineSmoke
 * URL = db://assets/Scripts/Smoke/IdleSubStateMachineSmoke.ts
 * ManualUrl = https://docs.cocos.com/creator/3.4/manual/zh/
 *
 */
const BASE_URL = 'texture/smoke/idle'

@ccclass('IdleSubStateMachineSmoke')
export class IdleSubStateMachineSmoke extends DirectionSubStateMachine {
  constructor(fsm: StateMachine) {
    super(fsm)
    this.stateMachines.set(
      DIRECTION_ENUM.TOP,
      new State(fsm, `${BASE_URL}/top`, AnimationClip.WrapMode.Normal, ANIMATION_SPEED / 1.5),
    )
    this.stateMachines.set(
      DIRECTION_ENUM.BOTTOM,
      new State(fsm, `${BASE_URL}/bottom`, AnimationClip.WrapMode.Normal, ANIMATION_SPEED / 1.5),
    )
    this.stateMachines.set(
      DIRECTION_ENUM.LEFT,
      new State(fsm, `${BASE_URL}/left`, AnimationClip.WrapMode.Normal, ANIMATION_SPEED / 1.5),
    )
    this.stateMachines.set(
      DIRECTION_ENUM.RIGHT,
      new State(fsm, `${BASE_URL}/right`, AnimationClip.WrapMode.Normal, ANIMATION_SPEED / 1.5),
    )
  }
}
